﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Collections;
using System.Data;
using CE.Database;

/// <summary>
/// Summary description for CCSupplementaryDB
/// </summary>
/// 
namespace CE.CreditCard
{
    public class CCSupplementaryDB
    {
        public CCSupplementaryDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(CCSupplementary ccsupplement)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocCCApplicantSupplementInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();

            _sPara.Add("@CCSuppId", ccsupplement.CCSuppId);
            _sPara.Add("@CCPersonnelId", ccsupplement.CCPersonnelId);
            _sPara.Add("@CCCARId", ccsupplement.CCARId);
            _sPara.Add("@CCSuppSalutation", ccsupplement.CCSuppSalutation);
            _sPara.Add("@CCSuppFirstName", ccsupplement.CCSuppFirstName);
            _sPara.Add("@CCSuppSurName", ccsupplement.CCSuppSurName);
            _sPara.Add("@CCSuppNameOfAppear", ccsupplement.CCSuppNameOfAppear);
            _sPara.Add("@CCSuppRelation", ccsupplement.CCSuppRelation);
            _sPara.Add("@CCSuppDOB", ccsupplement.CCSuppDOB);
            _sPara.Add("@CCSuppGender", ccsupplement.CCSuppGender);
            _sPara.Add("@CCSuppNationality", ccsupplement.CCSuppNationality);
            _sPara.Add("@CCSuppIdType", ccsupplement.CCSuppIdType);
            _sPara.Add("@CCSuppIdNo", ccsupplement.CCSuppIdNo);
            _sPara.Add("@CCSuppEmail", ccsupplement.CCSuppEmail);
            _sPara.Add("@CCSuppMobilePhoneNo", ccsupplement.CCSuppMobileNo);
            _sPara.Add("@CCSuppHomePhoneNo", ccsupplement.CCSuppHomePhone);
            _sPara.Add("@CCSuppOfficePhoneNo", ccsupplement.CCSuppOfficePhone);
            _sPara.Add("@CCSuppUnitNo", ccsupplement.CCSuppUnitNo);
            _sPara.Add("@CCSuppHomeNo", ccsupplement.CCSuppHomeNo);
            _sPara.Add("@CCSuppStreetName", ccsupplement.CCSuppStreetName);
            _sPara.Add("@CCSuppCountry", ccsupplement.CCSuppCountry);
            _sPara.Add("@CCSuppPostalCode", ccsupplement.CCSuppPostalCode);
            _sPara.Add("@RefCEUserId", ccsupplement.RefCEUserId);
            _sPara.Add("@ViewedDetailId", ccsupplement.ViewedDetailId);

            _sPara.Add("@Status", ccsupplement.CCStatus == true ? 1 : 0);
            _sPara.Add("@Info1", ccsupplement.CCInfo1);
            _sPara.Add("@Info2", ccsupplement.CCInfo2);
            _sPara.Add("@Info3", ccsupplement.CCInfo3);
            _sPara.Add("@Info4", ccsupplement.CCInfo4);
            _sPara.Add("@Info5", ccsupplement.CCInfo5);

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

    }
}